﻿<Window x:Class="MailCrawler.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:wt="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
    Title="Mail Crawler" Height="400" Width="600" Loaded="Window_Loaded" Closing="Window_Closing" Icon="pack://application:,,,/icon.png"  >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <TabControl Grid.Row="0" x:Name="ToBlock">
            <TabItem Header="Emails">
                <wt:DataGrid AutoGenerateColumns="True" x:Name="EMails" ItemsSource="{Binding}"/>
            </TabItem>
            <TabItem Header="Proxies">
                <wt:DataGrid AutoGenerateColumns="True" x:Name="Proxies" ItemsSource="{Binding}"/>
            </TabItem>
            <TabItem Header="Rules">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <wt:DataGrid Grid.Row="0" AutoGenerateColumns="True" x:Name="Rules" ItemsSource="{Binding}"/>
                    <Grid Grid.Row="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" VerticalAlignment="Center">Browser header</TextBlock>
                        <ComboBox ItemsSource="{Binding}" Grid.Column="1" x:Name="Headers" SelectionChanged="Headers_SelectionChanged">
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Path=Name}"/>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>
                    </Grid>
                </Grid>
            </TabItem>
            <TabItem Header="Log">
                <wt:DataGrid AutoGenerateColumns="True" IsReadOnly="True" x:Name="MessageList" ItemsSource="{Binding}"/>
            </TabItem>
        </TabControl>
        <Grid Grid.Row="1">
            <TextBlock>
                <Hyperlink Hyperlink.RequestNavigate="Hyperlink_RequestNavigate" NavigateUri="http://www.seomator.com/banners/mail-activator-banner.php">
                    <Image Source="http://www.seomator.com/banners/mail-activator-banner.jpg"/>
                </Hyperlink>
            </TextBlock>
        </Grid>
        <Grid Grid.Row="2">
            <TextBlock>
                <Hyperlink Hyperlink.RequestNavigate="Hyperlink_RequestNavigate_1" NavigateUri="manual.pdf">Help</Hyperlink>
            </TextBlock>
        </Grid>
        <StackPanel Margin="5" Orientation="Horizontal" Grid.Row="3">
            <TextBlock>Messages checked:</TextBlock>
            <TextBlock Text="{Binding}" x:Name="MessagesChecked"/>
            <TextBlock> | </TextBlock>
            <TextBlock>Founded count:</TextBlock>
            <TextBlock Text="{Binding}" x:Name="FoundedCount"/>
            <TextBlock> | </TextBlock>
            <TextBlock>Clicked count:</TextBlock>
            <TextBlock Text="{Binding}" x:Name="ClickedCount"/>
        </StackPanel>
        <StackPanel Orientation="Horizontal" Grid.Row="4" HorizontalAlignment="Right">
            <Button Padding="5" x:Name="Start" Click="Start_Click" Content="Start"/>
        </StackPanel>
    </Grid>
</Window>
